package com.mq.controller;

import com.mq.pojo.Blog;
import com.mq.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blog")
public class BlogController {
	@Autowired
	private BlogService blogService;

	@PostMapping("/getAll")
	public String getBlog(){
		List<Blog> blogs = blogService.queryAllBLog();
		System.out.println(blogs);
		return blogs.toString();
	}
}
